/**
 * 
 */
package com.teamall.web.app.common;

import com.teamall.framework.exception.BaseAppException;
import com.teamall.framework.util.SpringAppContextUtil;
import com.teamall.web.sys.db.po.SysUserTokenPO;
import com.teamall.web.sys.service.impl.SysUserTokenServiceImpl;

/** 
 * <Description> <br> 
 *  
 * @author pan.xiaobo<br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2017年8月13日 <br>
 * @since V1.0<br>
 * @see com.teamall.web.app.common <br>
 */

public class SysUserTokenPOGenerator {
    
    /**
     * 通过token获取用户对象
     * @param token
     * @return
     * @throws BaseAppException
     */
    public static SysUserTokenPO getUserByToken(String token) throws BaseAppException {
        SysUserTokenServiceImpl sysUserTokenService = SpringAppContextUtil.getBean(SysUserTokenServiceImpl.class);
        SysUserTokenPO sysUserTokenPO = sysUserTokenService.selectByToken(token);
        return sysUserTokenPO;
    }
}
